/*
 * $Id: QEADIFError.h 70 2009-06-15 13:57:58Z jon@bway.net $
 * Chalk
 *
 * Created 5/31/09
 * Copyright Jon Gordon
 * 
 * Permission is hereby granted, free of charge, to any person obtaining 
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including 
 * without limitation the rights to use, copy, modify, merge, publish, 
 * distribute, sublicense, and/or sell copies of the Software, and to 
 * permit persons to whom the Software is furnished to do so, subject to 
 * the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#import <Foundation/Foundation.h>

typedef enum {
    QEADIFNoError = 0,          // no error
    
    // syntax errors
    QEADIFErrorSynEOI = 1025,   // unexpected end of ADIF input
    QEADIFErrorSynEOL,          // unexpected end of line
    QEADIFErrorSynEOData,       // unexpected end of input while reading field data
    QEADIFErrorSynNoName,       // zero-length tag or field name
    QEADIFErrorSynBadName,      // illegal characters or format in tag or field name
    QEADIFErrorSynBadLength,    // illegal character in field length
    QEADIFErrorSynMissingType,  // type code expected but omitted
    QEADIFErrorSynBadType,      // unrecognized or illegal data type code
    QEADIFErrorSynNoClose,      // missing '>' character to close tag
    
    // errors in creating ADIF file from the list of elements supplied
    // by the parser
    QEADIFErrorNilParseOutput = 1089,   // nil list of elements from non-nil input
    
    // data validation errors
    QEADIFErrorDataNull = 1537, // null data where non-null required
    QEADIFErrorDataBlank,       // blank, non-null field, where non-blank required
    QEADIFErrorDataType,        // data is of wrong type
    QEADIFErrorDataRange,       // data is out of range valid for type
    QEADIFErrorDataUnenum,      // data has value that isn't one of legal enumerated values
    QEADIFErrorDataInvalid,     // data failed validation in a way that doesn't have a code
    QEADIFErrorEnumSpecMissing, // enumeration specifier required but not supplied
    QEADIFErrorEnumSpecBad,     // enumeration specifier in unrecognizable format
    QEADIFErrorEnumNotKnown,    // enumeration specifier names unknown enumeration
    
    // errors in the structure of the ADIF file or data
    QEADIFErrorHeaderFieldInBody = 1793 // header-only field seen outside of header
} QEADIFErrorCode;

#define QEADIFErrorDomain @"com.k3qe.ADIF.ErrorDomain"
